const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import('@/views/Login.vue'),
    meta: { title: "登录", isNeedToken: false },
  },
  {
    path: "/Home",
    component: resolve => require(['@/views/Home.vue'], resolve),
    meta: { title: "主页", isNeedToken: true },
    children: [
      {
        path: "",
        meta: { isNeedToken: true },
        redirect: {
          path: "User"
        }
      },
      {
        path: "User",
        meta: { title: "用户管理", icon: "idcard", isNeedToken: true },
        component: resolve => require(['@/views/User/Container.vue'], resolve),
        children: [
          {
            path: "",
            meta: { isNeedToken: true },
            redirect: {
              path: "User"
            }
          },
          {
            path: "User",
            component: resolve => require(['@/views/User/User.vue'], resolve),
            meta: { title: "用户管理", isNeedToken: true },
          },
        ]
      },
      {
        path: "Admin",
        meta: { title: "登录管理", icon: "idcard", isNeedToken: true },
        component: resolve => require(['@/views/Admin/Container.vue'], resolve),
        children: [
          {
            path: "",
            meta: { isNeedToken: true },
            redirect: {
              path: "Account"
            }
          },
          {
            path: "Account",
            component: resolve => require(['@/views/Admin/Account.vue'], resolve),
            meta: { title: "账户设置", isNeedToken: true },
          },
          {
            path: "AccountDetail",
            component: resolve => require(['@/views/Admin/AccountDetail.vue'], resolve),
            meta: { title: "账户", isNeedToken: true, isHideMenu: true },
          },
          {
            path: "Role",
            component: resolve => require(['@/views/Admin/Role.vue'], resolve),
            meta: { title: "角色设置", isNeedToken: true },
          },
          {
            path: "RoleDetail",
            component: resolve => require(['@/views/Admin/RoleDetail.vue'], resolve),
            meta: { title: "角色", isNeedToken: true, isHideMenu: true },
          },
        ]
      },
    ]
  }
]

export default routes
